<template>
  <!-- 志愿选择 -->

	<ul>
		<li v-for="(row, index) in choices" :key="index">
			学生ID：{{ row[0] }}，学生姓名： {{ row[1] }}，志愿顺序：{{ row[2] }}
		</li>
	</ul>
</template>
  
<script setup>
import {RouterView,RouterLink} from 'vue-router'
import { useCounterStore } from '@/stores/counter'
import { onMounted, ref } from 'vue';
import axios from 'axios';
const choices = ref([])

const counter = useCounterStore()

const getChoice = (tutor_id) => {
	const token = sessionStorage.getItem('token')
	axios.get(`http://127.0.0.1:5000/find_tutor/${tutor_id}`, {
      headers: {
          Authorization: `Bearer ${token}`
      }
  	}).then(res => {
      console.log(res);
	  console.log(res.data)
	  choices.value = res.data
  	})
}

onMounted(() => {
	getChoice(counter.user_id)
})
</script>

<style scoped>
h1, h2 {
  color: #2c3e50;
}

p {
  margin: 1em 0;
}

div {
  padding: 20px;
}
</style>
  